﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using OBUCare.Core.Models;

namespace OBUCare.Web.Models
{
    public class RepairOrderViewModel
    {
        [DisplayName("编号")]
        //[ScaffoldColumn(false)]
        public long ID { get; set; }

        [DisplayName("维修单号")]
        public string REPAIR_ORDER_NO { get; set; }

        [DisplayName("标签号")]
        public string OBU_NO { get; set; }

        [DisplayName("客户编号")]
        public string USER_NO { get; set; }

        [DisplayName("所有人")]
        public string USER_Name { get; set; }

        [DisplayName("标签发行时间")]
        public System.DateTime REGISTER_DATE { get; set; }

        [DisplayName("送修人")]
        public string REPORTER { get; set; }

        [DisplayName("联系电话")]
        public string TEL_NO { get; set; }

        [DisplayName("手机号")]
        public string MOBILE_TEL_NO { get; set; }

        [DisplayName("可接受维修费用")]
        public Nullable<decimal> MAX_PRICE { get; set; }

        [DisplayName("受理营业厅")]
        public string AGENT_NO { get; set; }

        [DisplayName("受理营业厅")]
        public string AGENT_Name { get; set; }

        [DisplayName("终端IP")]
        public string CLIENT_IP { get; set; }

        [DisplayName("外观检测后状态")]
        public bool FACE_STATUS { get; set; }

        [DisplayName("维修性质")]
        public int REPAIR_TYPE { get; set; }

        [DisplayName("维修性质")]
        public string REPAIR_TYPE_Text { get; set; }

        [DisplayName("维修性质备注")]
        public string REPAIRED_COMMENT { get; set; }

        [DisplayName("有偿维修")]
        public Nullable<bool> IS_FREE { get; set; }

        [DisplayName("备用电子标签号")]
        public string SPARE_OBU_NO { get; set; }

        [DisplayName("备用电子标签押金")]
        public Nullable<decimal> SPARE_OBU_PRICE { get; set; }

        [DisplayName("备用标签安装日期")]
        public Nullable<System.DateTime> SPARE_OBU_ISSUE_DATE { get; set; }

        [DisplayName("状态")]
        public int STATUS { get; set; }

        [DisplayName("状态")]
        public string STATUS_Text { get; set; }

        [DisplayName("当前操作员")]
        [ScaffoldColumn(false)]
        public string CURRENT_HANDLER { get; set; }

        [DisplayName("确认维修的结果")]
        public int CONFIRM_REPAIRED { get; set; }

        [DisplayName("处置方式")]
        public int DISPOSE_TYPE { get; set; }

        [DisplayName("维修完成日期")]
        public Nullable<System.DateTime> FINISHED_DATE { get; set; }

        [DisplayName("用户取回标签时间")]
        public Nullable<System.DateTime> GET_BACK_DATE { get; set; }

        [DisplayName("是否完整归还备签")]
        public Nullable<bool> IS_RETURNED_SPARE_OBU { get; set; }

        /// <summary>
        /// 归还备用标签的备注
        /// </summary>
        [DisplayName("备注")]
        public string RETURNED_COMMENT { get; set; }

        [DisplayName("操作员")]
        public string CREATED_BY { get; set; }

        [DisplayName("录入时间")]
        public System.DateTime CREATED_DATE { get; set; }

        [DisplayName("修改人")]
        [ScaffoldColumn(false)]
        public string MODIFY_BY { get; set; }

        [DisplayName("修改时间")]
        [ScaffoldColumn(false)]
        public System.DateTime MODIFY_DATE { get; set; }

        [DisplayName("厂商")]
        public string SUPPLIER { get; set; }

        [DisplayName("型号")]
        public string SPEC_NAME { get; set; }

        [DisplayName("车牌号")]
        public string VEHICLE_PLATE_NO { get; set; }

        [DisplayName("车型")]
        public short VEHICLE_CLASS { get; set; }

        [DisplayName("车型")]
        public string VEHICLE_CLASS_NAME { get; set; }

        public RepairOrderViewModel() { }

        public RepairOrderViewModel(REPAIR_ORDERS o)
        {
            ID = o.ID;
            REPAIR_ORDER_NO = o.REPAIR_ORDER_NO;
            OBU_NO = o.OBU_NO;
            USER_NO = o.USER_NO;
            REGISTER_DATE = o.REGISTER_DATE;
            REPORTER = o.REPORTER;
            TEL_NO = o.TEL_NO;
            MOBILE_TEL_NO = o.MOBILE_TEL_NO;
            MAX_PRICE = o.MAX_PRICE;
            AGENT_NO = o.AGENT_NO;
            CLIENT_IP = o.CLIENT_IP;
            FACE_STATUS = o.FACE_STATUS;
            REPAIR_TYPE = o.REPAIR_TYPE;
            REPAIRED_COMMENT = o.REPAIRED_COMMENT;
            IS_FREE = o.IS_FREE;
            SPARE_OBU_NO = o.SPARE_OBU_NO;
            SPARE_OBU_PRICE = o.SPARE_OBU_PRICE;
            SPARE_OBU_ISSUE_DATE = o.SPARE_OBU_ISSUE_DATE;
            STATUS = (int)o.STATUS;
            CURRENT_HANDLER = o.CURRENT_HANDLER;
            CONFIRM_REPAIRED = o.CONFIRM_REPAIRED;
            DISPOSE_TYPE = o.DISPOSE_TYPE;
            FINISHED_DATE = o.FINISHED_DATE;
            GET_BACK_DATE = o.GET_BACK_DATE;
            IS_RETURNED_SPARE_OBU = o.IS_RETURNED_SPARE_OBU;
            RETURNED_COMMENT = o.RETURNED_COMMENT;
            CREATED_BY = o.CREATED_BY;
            CREATED_DATE = o.CREATED_DATE;
            MODIFY_BY = o.MODIFY_BY;
            MODIFY_DATE = o.MODIFY_DATE;
        }
    }
}